home *** CD-ROM | disk | FTP | other *** search
/ Best of Shareware / Best of PC Windows Shareware 1.0 - Wayzata Technology (7111) (1993).iso / mac / DOS / CAD_CAM / GCPVU / GERBER.DOC < prev    next >
Text File  |  1992-05-11  |  15KB  |  428 lines

  1.  
  2.      UNDERSTANDING YOUR CAD OUTPUT: BASIC PHOTOPLOTTING PRINCIPLES
  3.  
  4.          A supporting document for GraphiCode's GC-PREVUE: Shareware PCB
  5.          CAD output data viewer/checkplot utility
  6.  
  7.          Copyright (C) GraphiCode Inc 1991,1992 All Rights Reserved.
  8.  
  9.  
  10.  
  11.       What's a Photoplotter?
  12.  
  13.  
  14.      A photoplotter is just what the name implies: an plotter that
  15.      writes using light.  A plotter has to be told:
  16.  
  17.        Which tool to use.
  18.        When to use the tool, and when not to.
  19.        Where to go next.
  20.        Whether to go there in a straight line or along an arc.
  21.  
  22.      For a photoplotter, "tool" means specially shaped apertures
  23.      through which light passes to create a given shape on film.  An
  24.      aperture can be used without movement to make a shape (a "flash")
  25.      or with movement to make a line or an arc.
  26.  
  27.      There are two major types of photoplotters, "Vector" and "Raster"
  28.      (or "laser").  Each handles apertures differently.
  29.  
  30.      Vector Photoplotters
  31.  
  32.      Aperture Wheels
  33.  
  34.      Traditionally, the photoplotter counterpart to a pen plotter's
  35.      pen rack has been the aperture wheel.  The aperture wheel is a
  36.      disk with 24 or 70 apertures arrayed radially along its
  37.      circumference.
  38.  
  39.      When the photoplotter selects an aperture, the aperture wheel is
  40.      rotated to place the desired aperture between the light source
  41.      and the film.  Apertures are themselves pieces of film and can be
  42.      made to any shape required, although in practice this is a time-
  43.      consuming process and there is a physical limitation on size.
  44.  
  45.      Flash and Draw Apertures
  46.  
  47.      To achieve constant exposure on a vector photoplotter, apertures
  48.      used for flashing pads are filtered differently than those used
  49.      for drawing traces.  Therefore, Flash and Draw apertures cannot
  50.      be used interchangeably without risk of localized over-exposure
  51.      and under-exposure.
  52.  
  53.      Aperture Wheel Setup for Vector Plotters
  54.  
  55.      The setup of an aperture wheel is an exacting and time consuming
  56.      process since each aperture in the wheel must be hand-mounted and
  57.      aligned.  In order to avoid repeated setup costs, designers have
  58.      the photoplotting vendor keep a wheel on file and are forced to
  59.      always use that same set of apertures.  This has obvious
  60.  
  61.  
  62.  
  63.      drawbacks, both in terms of design flexibility and the ease of
  64.      migration to other vendors.
  65.  
  66.      Raster (Laser) Plotters
  67.  
  68.      Aperture Lists
  69.  
  70.      Increasingly, vector photoplotters are being replaced by the
  71.      laser photoplotter, which emulates the older style machine in a
  72.      raster (bit-map) fashion.  While use of the term "aperture" to
  73.      describe a pad or trace shape persists, the term "aperture wheel"
  74.      is now being replaced by "aperture list", which implies the
  75.      greater flexibility now available to the designer.
  76.  
  77.      There are three principle advantages with aperture lists on
  78.      raster plotters:
  79.  
  80.        Aperture shapes can be easily generated in software, thus
  81.        eliminating the need to design a physical wheel.
  82.        More apertures can be defined on a list.
  83.        Allowable apertures sizes are typically (but not always)
  84.        greater than those imposed by the physical dimensions of an
  85.        aperture wheel.
  86.  
  87.      Flash and Draw Apertures
  88.  
  89.      No distinction need be made between Flash and Draw aperture types
  90.      since the light source intensity is constant.
  91.  
  92.      Speed Advantage of Laser Plotters
  93.  
  94.      Laser plotters operate much quicker than vector machines.  A
  95.      complex plot that required hours on a vector machine can usually
  96.      be performed in ten minutes or less on a laser photoplotter.
  97.      This decreases turnaround time and in many markets has driven
  98.      photoplotting costs down.
  99.  
  100.      Talking to Photoplotters
  101.  
  102.      The de facto standard for photoplotter data is the Gerber format,
  103.      more properly known as RS-274D.  The term Gerber refers to the
  104.      Gerber Scientific Instrument company, a pioneer and leader in
  105.      photoplotter manufacturing.
  106.  
  107.      RS-274D is a variation on traditional Numerical Control (NC)
  108.      machine tool languages.  It differs from traditional NC formats
  109.      (i.e. drill data), as far as its use of tool selection codes but
  110.      is otherwise compatible.
  111.  
  112.      RS-274D data is organized in "blocks".  A block consists of a
  113.      combination of codes:
  114.  
  115.  
  116.  
  117.        Tool selection
  118.        Setup
  119.        Movement
  120.        And, an End Of Block (EOB) character, which only follows a
  121.        combination of the above codes.
  122.  
  123.      An EOB character is usually an asterisk ('*') or dollar ('$'),
  124.      optionally followed by a carriage return and line feed.
  125.  
  126.      An RS-274D code consists of a letter D,G,M,X,Y,I or J followed by
  127.      a numerical value.  These codes designate the following:
  128.  
  129.        * - End of Block (end of command)
  130.  
  131.        D - Select aperture, or set aperture use mode
  132.  
  133.        X - Move to X value
  134.  
  135.        Y - Move to Y value
  136.  
  137.        G - Various setup codes
  138.  
  139.        M - Various control codes
  140.  
  141.        I - Relative X location for arc center
  142.  
  143.        J - Relative Y location for arc center
  144.  
  145.      D Codes
  146.  
  147.      D codes have multiple purposes.  The first is to control the
  148.      state of the light being on or off. Valid codes for light state
  149.      are D01, D02, and D03.
  150.  
  151.        D01 - Light on for next move.
  152.  
  153.        D02 - Light off for next move.
  154.  
  155.        D03 - Flash (Light On, Light Off) after move (effect is limited
  156.        to block in which appears, ie non-modal).  You can also think
  157.        of a D03 as D02, D01, D02 series of commands linked together.
  158.  
  159.      D codes with values of 10 or greater represent the aperture's
  160.      position on the list or wheel.  It is very important to
  161.      understand that there is no universal "D10" or "D30".  Unlike the
  162.      D01 , D02, and D03 counterparts which have a fixed meaning (draw,
  163.      move, flash), D10 and higher values have aperture shapes and
  164.      dimensions assigned to them by each individual user.  Hence, one
  165.      job's D10 could be a 10 mil Round, when another job's D10 could
  166.      be a 45 mil Square.
  167.  
  168.      There are two distinct ways to number an aperture list.  The
  169.      traditional 24 aperture system started with D10 - D19, jumping
  170.      suddenly to D70 - D71, then back to D20 - D29, ending with D72 -
  171.  
  172.  
  173.  
  174.      D73.  This is still a common format for output for CAD packages,
  175.      and is still mandatory for old 24 aperture Gerber vector
  176.      photoplotters.
  177.  
  178.      It is now common to start with D10, then increase numerically in
  179.      steps of 1 (D10, D11, etc.) continuing up to D70 and beyond,
  180.      rarely beyond 1000 individual apertures.
  181.  
  182.      X & Y Codes
  183.  
  184.      The X & Y values in the Gerber file determine where the aperture
  185.      shape and dimension will be positioned and drawn.  X & Y values
  186.      are used as coordinate pairs to determine where the light will be
  187.      exposed, using the D codes shapes (i.e. D10) and light exposure
  188.      status (i.e. D01, D02, D03) for drawing lines and arcs, as well
  189.      as moving between drawing entities.
  190.  
  191.      Here are a few examples of using X & Y codes with D codes.
  192.  
  193.        D10*  { Select aperture D10}
  194.  
  195.        X1000Y1000D02* { The D02 tells us that the light will be off,
  196.        and we move to coordinate position X1000 and Y1000}
  197.  
  198.        X2000Y3000D01* { The D01 tells us that we will draw (light on)
  199.        to coordinate position X2000 and Y3000}
  200.  
  201.        X5500Y100D03* { The D03 tells us to move to coordinate position
  202.        X5500 and Y100 with the light off, then flash (turn the light
  203.        on and off)}
  204.  
  205.      G Codes
  206.  
  207.      G codes are used to configure the photoplotter.  Commonly
  208.      implemented codes include:
  209.  
  210.  
  211.  
  212.        G01 - Future X,Y commands are straightline moves
  213.  
  214.        G02 - Future X,Y commands are clockwise arcs
  215.  
  216.        G03 - Future X,Y commands are counterclockwise arcs
  217.  
  218.        G04 - Ignore the rest of this block (used for Comments)
  219.  
  220.        G54 - Prepare to change apertures
  221.  
  222.        G74 - Future arcs are quadrant arcs
  223.  
  224.        G75 - Future arcs are Full 360 arcs
  225.  
  226.        G90 - Absolute data
  227.  
  228.        G91 - Incremental data
  229.  
  230.  
  231.  
  232.      Typically for laser photoplotters, G54 codes are rarely
  233.      necessary.  Older vector plotter controllers may require this
  234.      preparatory G codes for changing apertures (i.e. G54D10*).
  235.  
  236.      A common situation where G codes are mandatory for all machines
  237.      is when the data is switching from vectors to arcs and vice
  238.      versa.  When switching from drawing vectors (G01) to drawing arc
  239.      (G02, G03), the controller must be informed of the change of
  240.      mode.
  241.  
  242.      Another important case for G codes is when determining if the arc
  243.      is a quadrant (G74) or Full 360 (G75).  Quadrant arcs never cross
  244.      quadrant boundaries, because the center coordinate offsets (I,J
  245.      Codes) are always unsigned (even if they are negative!).
  246.      Therefore, it requires at least four G74 arcs to draw one
  247.      complete circle.
  248.  
  249.      Center coordinate offsets for 360 arcs (G75) can be positive or
  250.      negative, allowing for a single command to draw a complete
  251.      circle.
  252.  
  253.      In either case, the center coordinates are given relative to the
  254.      start point of the arc.  The most dramatic difference between
  255.      Quadrant and Full 360 arcs is that a Quadrant arc with identical
  256.      start and end points has a sweep of 0 degrees, whereas a similar
  257.      Full 360 arc is a full circle.
  258.  
  259.      The G90 code tells the machine controller that all data following
  260.      is absolute data.  Hence, if following X & Y data follows, the
  261.      controller will move to the absolute value given by the X & Y
  262.      value.
  263.  
  264.  
  265.  
  266.      G91 tells the machine controller that all data following is
  267.      incremental data.  The machine will move the data by the amount
  268.      of the X & Y value, rather than to the absolute coordinate point.
  269.  
  270.      Example:
  271.  
  272.        X1000Y1000D02*
  273.  
  274.        X3000Y3000D01*
  275.  
  276.  
  277.  
  278.      In absolute mode (G90), the machine will first move to coordinate
  279.      point X1000 and Y1000 with the light off, then draw a line to
  280.      coordinate point X3000 and Y3000 with the light on.
  281.  
  282.      In incremental mode (G91)  the machine will first move to
  283.      coordinate point X1000 and Y1000 with the light off, then draw a
  284.      line to coordinate point X4000 and Y4000 with the light on.  This
  285.      was done by adding X1000 + X3000 = X4000 and Y1000 + Y3000 =
  286.      Y4000.
  287.  
  288.      Here are some more examples of G code usage in conjunction with
  289.      X, Y, and D code values:
  290.  
  291.        G54D10*      { Prepare to change aperture position (G54), then
  292.        select aperture D10}
  293.  
  294.        G01X1000Y1000D02*      { Prepare to draw a vector (G01) then
  295.        turn off the light (D02) and move to coordinate position X1000
  296.        and Y1000}
  297.  
  298.        G90*    { This block (command) and all future commands will be
  299.        absolute data}
  300.  
  301.        X2000Y3000D01*    Turn the light on (D01) and move to absolute
  302.        coordinate position X2000 and Y3000}
  303.  
  304.        G91*              { The G91 command tells the controller that
  305.        this command and all future commands that the data is
  306.        incremental}
  307.  
  308.        X5500Y100D03*     { Turn the light off and move incrementally
  309.        by a value of X5500 and Y100, then flash (D03) (light on and
  310.        off)}
  311.  
  312.      M Codes
  313.  
  314.      M codes are used for machine control.  Here are the most commonly
  315.      used:
  316.  
  317.  
  318.  
  319.        M00 - Full machine stop.  Commonly ignored by many plotters.
  320.  
  321.        M01 - Temporary machine stop.  Commonly ignored by many
  322.        plotters.
  323.  
  324.        M02 - End of Plot.
  325.  
  326.      I & J Codes
  327.  
  328.      When you encounter an I & J code in a Gerber block, you have
  329.      found an arc command.  Arc commands come in two flavors, Full 360
  330.      or Quadrant.  The Gerber arc command is very complicated, and
  331.      this section will only briefly describe usage of the Gerber arc.
  332.  
  333.      Full 360 arcs allow the plotter to draw a full circle (360
  334.      degrees of arc) in one single command..
  335.  
  336.      Quadrant arcs only allow for an arc to be drawn through a maximum
  337.      of 90 degrees of arc, never crossing a quadrant boundary.  Due to
  338.      this restriction, I and J arc center offset codes can get away
  339.      with never having a negative value, even if the offsets are
  340.      negative!
  341.  
  342.      When in a Full 360 arc (G75), only one command is required to
  343.      draw a circle.  In Quadrant mode, the same circle would require
  344.      at leaset 4 Quadrant arcs (G74), because a circle goes through
  345.      all four quadrants.
  346.  
  347.      Quadrant arcs will always have positively signed I and J values,
  348.      even if the center offset is actually negative.  Full 360 arc
  349.      center offsets can be signed positively or negatively.  A
  350.      negative I or J is a sure indicator of Full 360 arcs.
  351.  
  352.      Modality
  353.  
  354.      It is often the case with Gerber data that when moving from one
  355.      XY coordinate point to another XY coordinate point, the X or Y
  356.      value will not change.  Likewise, it is likely that if the
  357.      plotter is drawing a line with multiple segments, the segments
  358.      will be connected and the light stays on from segment to segment.
  359.  
  360.      In both of these cases, there are redundant commands, making the
  361.      plot data file larger than necessary.
  362.  
  363.      RS-274D allows you to omit this redundant data.  This example
  364.      shows a box being drawn with four corners.
  365.  
  366.  
  367.  
  368.        Non Modal Data         Modal Data
  369.  
  370.        X0000Y0000D02*         X1000Y1000D02*
  371.  
  372.        X0000Y1000D01*         Y1000D01*
  373.  
  374.        X1000Y1000D01*         X1000*
  375.  
  376.        X1000Y0000D01*         Y0000*
  377.  
  378.        X0000Y0000D01*         X0000*
  379.  
  380.      From this example, a large amount of data has not been written,
  381.      thus reducing the final data file size.
  382.  
  383.      Establishing the Decimal Point
  384.  
  385.      A numerical value in RS-274D data has an integer and a decimal
  386.      part, but the decimal point ('.') is not a valid RS-274D
  387.      character.  Thus, decimal values are written as a string of
  388.      integers.  The implicit position of the decimal point is
  389.      determined by three parameters:
  390.  
  391.        Number of integer digits (whole digits)
  392.        Number of decimal digits (precision)
  393.        Zero suppression.
  394.  
  395.      For example: In a system with integer digits=n and decimal
  396.      digits=m (an "n,m" system), a numerical value is written using
  397.      (n+m) digits.
  398.  
  399.      For example, in a "2,3" format the value 12.345 is written
  400.      "12345".  In a "2,4" format, the same value is written "123450".
  401.  
  402.      Zero suppression comes in three flavors - leading, trailing and
  403.      none.  The idea of zero suppression is to reduce data file sizes
  404.      by eliminating unneeded 0 characters.  The simplest and most
  405.      common form of zero suppression is leading zero suppression.
  406.  
  407.      In a "2,4" format, with no zero suppression, the value 0.0100
  408.      would be 00 + 01000, written as "000100", but with leading zero
  409.      suppression the same value is written as "100".
  410.  
  411.      With trailing zero suppression the same value 0.0100 would be
  412.      written as "0001".
  413.  
  414.      How To Describe Data Formats
  415.  
  416.      Gerber data and other XY languages use a standard method for
  417.      describing the data format.  Two examples include:
  418.  
  419.  
  420.  
  421.        "2,3 leading inch" or "3,3 trailing metric".  The first number
  422.        specifies the whole digits used.  The second parameter states
  423.        the precision.  "Leading" and "trailing" pertain to the zero
  424.        suppression.  And the last part of the description indicates
  425.        the units.  Refer to the above sections if these concepts seem
  426.        unclear.
  427.  
  428.